from langchain_core.output_parsers import StrOutputParser

parser = StrOutputParser()
model_output = "  Hello LangChain!  "

print("原始输出：", repr(model_output))
print("解析后：", repr(parser.invoke(model_output)))
# 原始输出： '  Hello LangChain!  '
# 解析后： 'Hello LangChain!'
